<meta charset='utf-8' />
<title>信息后台</title>
<style>
	.poi{cursor:pointer;}
</style>

<div style='text-align:right;margin:10px;font-size:12px'>
	<span id='index_userInfo'> sxx</span>　
	<span onclick='_indexExit()' class='poi'>退出</span>
</div>

<div id='indexArea'>


</div>


<script src='./public/fun.js'></script>
<script src='./public/jquery.js'></script>
<script>
$(function(){
	_init();







});

function _init(){
	if(!sessionStorage.adminInfo){
		Ajax({},function(res){
			$('#indexArea').html(res);
		},'./index_login.html')
	}else{
		$('#index_userInfo').text(sessionStorage.adminInfo);	//显示用户名
		_jumpMain();	//获取总览页面
	}
}




function _indexExit(){
	sessionStorage.adminInfo = '';
	location.reload();
}


//获取总览页面
function _jumpMain(){
	Ajax({},function(res){
		$('#indexArea').html(res);
	},'./index_main.html')
}

//获取区域浏览页面
function _jumpMain2(){
	Ajax({},function(res){
		$('#indexArea').html(res);
	},'./index_main2.html')
}







/*
	### 获取指定城市信息列表
	cityCode	城市代码
	fun 		回调
	type 		有值为直接从后台获取
*/
function _getCityDataList(cityCode,fun,type){
	if(type){
		_getCityDataListAfter(fun);
	}else{
		if(!cityData || typeof(cityData) != 'object'){
			_getCityDataListAfter(fun);
		}else{
			C('cityData from data');
			if(fun) fun();
		}

	}

	function _getCityDataListAfter(fun){
		C('cityData from after');
		Ajax({},function(res){
			if(/^{.*}$/.test(res)){
				cityData = JSON.parse(res);
				if(fun) fun();
			}else{
				A('加载地区信息列表异常！');
				if(fun) fun();
			}
		},'./data/'+cityCode);
	}
}

</script>